<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>::中国联通3G上网清单查询</title>
<link rel="shortcut icon" href="images/chinaunicom.ico"/>

<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$('input[class=inputMouseOut]').each(function(){
			var obj = $(this);
			obj.focus(function(){
				obj.removeClass('inputMouseOut');
				obj.addClass('inputMouseIn');
			});
			
			obj.blur(function(){
				obj.removeClass('inputMouseIn');
				obj.addClass('inputMouseOut');
			});
		});
		//ENTER
		document.onkeydown= function(event){
			var event = event||window.event;
			var code = event.keyCode?event.keyCode:(event.which?event.which:event.charCode);
			
			if(code == 13 ){
		    	event.returnValue=false;
		    	var btnOk = document.getElementById('btnOk');
		    	if(!btnOk.disabled) btnOk.click();
			}
		}
		
	});
	function doLogin(btn){
		var username = $('#username').val();
		var password = $('#password').val();
		if($.trim(username).length<1){
			$('#errorMsgDiv').html('用户名不能为空');
			return ;
		}
		if($.trim(password).length<1){
			$('#errorMsgDiv').html('密码不能为空');
			return ;
		}
		btn.disabled=true;
		$('#errorMsgDiv').html('<font style="color:#666999">正在登陆...</font>');
		$.post('user!login.action',{'entity.username':username,'entity.password':password},function(result){
			$('#errorMsgDiv').html('');
			if(result.success){
				window.location.href='user!viewDetailPage.action?entity.bindIP='+result.data.bindIP;
			} else {
				$('#errorMsgDiv').html(result.data);
			}
			btn.disabled=false;
		},'json');
		
	}
</script>
<link rel="stylesheet" type="text/css" href="css/user.css"/>
<style type="text/css">

input{
	border:1px solid #EEE;
	width:250px;
	height:25px;
	line-height:23px;
	vertical-align: middle;
}
.inputMouseIn{
	border:1px solid #666999;
	background-color:#FFFCCC;
}
.inputMouseOut{
	border:1px solid #aaa;
	background-color:#FFF;
}

.fieldrow{
	width:100%;
	margin:10px 0px;
	line-height: 27px;
	height: 27px;
}
.fieldrow label{
	font-weight:bold;
	float:left;
	width:80px;
	margin-left:120px;
	text-align: right;
}
.fieldrow span {
	float:left;
}
#errorMsgDiv {
	font-size:14px;
	color:red;
	height:45px;
}
.panel-body{
	padding-top:45px;
}
</style>

</head>
<body>

	<div id="main" >
		<div class="panel-center" style="width:600px;margin:0 auto;text-align:center">
			<div class="panel-title"><span style="float:left;padding-left:10px">中国联通</span>
			<span><a href="javascript:void(0)" onclick="window.close();" style="float:right;padding-right:10px;color:#111" title="点击关闭">关闭 </a></span></div>
			<div class="panel-body">
				<div  id="errorMsgDiv">
					${requestScope.errorMsg}
				</div>
				<div class="fieldrow">
					<label>卡&nbsp;号:&nbsp;&nbsp;</label><span class="fieldinput"><input id="username" name="username" class="inputMouseOut"/></span>
				</div>
				<div class="fieldrow">
				 	<label>PUK码:&nbsp;&nbsp;</label><span class="fieldinput"><input id="password" name="password" type="password" class="inputMouseOut"/></span>
				</div>
				<div class="fieldrow">
				 	<br/>
				</div>
				<div class="fieldrow" style="text-align:center">
					<input id="btnOk" type="button" value="登陆" class="btn blue" style="width:80px;height:30px" onclick="doLogin(this);"/>
					
				</div>
				<br/>
			</div>
		</div>
		
		<div style="text-align:center;">
			如果您有任何疑问，请<a href="message.jsp">留言</a>给我们
		</div>
	</div>
</body>
</html>